package cn.zifangsky.jvm.part1.structure.holder;

import lombok.Data;

/**
 * 一盘食物
 *
 * @author zifangsky
 * @date 2020/7/2
 * @since 1.0.0
 */
@Data
public class Dish {
    /**
     * 菜肴名称
     */
    private final String name;
    /**
     * 是否是素菜
     */
    private final boolean vegetarian;
    /**
     * 包含多少卡路里
     */
    private final int calories;
    /**
     * 类型
     */
    private final Type type;

    public Dish(String name, boolean vegetarian, int calories, Type type) {
        this.name = name;
        this.vegetarian = vegetarian;
        this.calories = calories;
        this.type = type;
    }

    /**
     * 类型
     */
    public enum Type {
        /**
         * 肉
         */
        MEAT("肉"),
        /**
         * 鱼
         */
        FISH("鱼"),
        /**
         * 其他
         */
        OTHER("其他");
        private String name;

        Type(String name) {
            this.name = name;
        }
    }
}
